package m.system.handler;

import com.alibaba.fastjson.JSONObject;
import m.system.util.ObjectUtil;

import java.util.Date;

public class CommonHandler {
    @HandlerMethodMeta(name = "sys/fillSysTime",description = "系统/填充系统时间",level = 9)
    public static JSONObject fillSysTime(JSONObject model) {
        model.computeIfAbsent("sysCreateTime", k -> new Date());
        model.put("sysUpdateTime", new Date());
        return model;
    }
    @HandlerMethodMeta(name = "sys/stringTrim",description = "系统/字符属性去两端空格",level = 2)
    public static JSONObject stringTrim(JSONObject model){
        return ObjectUtil.trim(model);
    }
}
